package org.googlecode.lightning.search.parse.parser;

import org.daragon.fulltext.segment.Holder;

/**
 * This class is a abstract implementation of Parser
 * 
 * @author daragon
 * 
 */
public abstract class SimpleDocParser implements Parser {
	
	/**
	 * Parse the given file and return the content of the file
	 */
	public String parse(String uri, Holder holder) {
		String text = null;

		try {
			text = extractText(holder);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return text;
	}

	/**
	 * 
	 * @param holder
	 * @return
	 * @throws Exception
	 */
	protected abstract String extractText(Holder holder) throws Exception;
}
